package com.micro.commonlibrary.tools;

import android.content.Context;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;

import com.micro.commonlibrary.application.CommonApplication;

/*
  一些关于UI 的小工具
 */
public class UiTools {
    private UiTools() {

    }

    public static Context getContext() {

        return CommonApplication.getMyApplicationContext();
    }

    public static Resources getResources() {
        return getContext().getResources();
    }

    public static int getColor(int color) {
        return getResources().getColor(color);
    }

    public static Drawable getDrawable(int drawable) {
        return getResources().getDrawable(drawable);
    }

    public static int getScreenWidth() {
        return getResources().getDisplayMetrics().widthPixels;
    }

    public static int getScreenHeight() {
        return getResources().getDisplayMetrics().heightPixels;
    }

    public static String getPackageName() {
        return getContext().getPackageName();
    }
}
